import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import AutoImport from 'unplugin-auto-import/vite';

// https://vitejs.dev/config/
export default defineConfig( {
  plugins: [
    vue(),
    AutoImport( {
      imports: [ 'vue', 'vuex', 'vue-router', 'pinia' ]
    } )
  ],
  resolve: {
    alias: {
      '@': path.resolve( './src' )
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://www.wuhaijun888.com:8888',
        changeOrigin: true,
        rewrite: path => path.replace()
      }
    }
  }
} )
